// for...of 循环

const arr = [100, 200, 300, 400];

for (const item of arr) {
    console.log(item);
}

arr.forEach((item) => {
    console.log(item);
});

for (const item of arr) {
    console.log(item);
    if (item > 100) {
        break;
    }
}

// arr.forEach 不能跳出循环
// arr.some
// arr.every

const s = new Set(['foo', 'bar']);

for (const item of s) {
    console.log(item);
}

const m = new Map();
m.set('foo', '123');
m.set('bar', '445');

for (const [key, value] of m) {
    console.log(key, value);
}

const obj = { foo: '132', bar: '1234' };
for (const item of obj) {
    console.log(item);
}
